from .base import Base
from .engine import db
from .types import StringUUID
from sqlalchemy import func

class Account(Base):
    __tablename__ = "accounts"
    __table_args__ = (db.PrimaryKeyConstraint("id", name="account_pkey"),)

    id = db.Column(StringUUID, server_default=db.text("uuid_generate_v4()"))
    name = db.Column(db.String(255), nullable=False)
    email = db.Column(db.String(255), nullable=False, unique=True)
    # Add other relevant fields for a user account as needed for a standalone service
    # For now, keeping it minimal to resolve dependency.
    created_at = db.Column(db.DateTime, nullable=False, server_default=func.current_timestamp())
    status = db.Column(db.String(16), nullable=False, server_default=db.text("\"active\"::character varying"))

    def __repr__(self):
        return f"<Account(id={self.id}, name=\"{self.name}\", email=\"{self.email}\")>"

